using System;
using Prjinit.Templates.Core;
using XenoGears;

namespace Prjinit.Templates
{
    [Template("lite"), Default]
    internal class LiteTemplate : ExtractAndMacroExpandTemplate
    {
        protected override String MacroExpand(String s)
        {
            var projectName = Cfg.ProjectName;
            var projectId = "project-id".TlsGetOrCreate(() => Guid.NewGuid().ToString().ToUpper());
            var currentYear = DateTime.Now.Year.ToString();

            return s.Replace("%ProjectName%", projectName)
                .Replace("%ProjectId%", projectId)
                .Replace("%CurrentYear%", currentYear);
        }
    }
}